import './index.less'
import React from 'react'

const ABlock = (props) => {
  const { dataList = [] } = props
  if (dataList?.length === 0) return null
  return dataList.map((item) => {
    if (item?.render) return item?.render?.()
    return (
      <div className="a-block-item" key={item?.label}>
        <div>
          {!item?.hideLabel && (
            <span className="a-block-item-label">{item?.label}：</span>
          )}
          {item?.renderValue ? (
            item?.renderValue?.()
          ) : (
            <span className="a-block-item-value">{item.value || '--'}</span>
          )}
        </div>
      </div>
    )
  })
}
export default ABlock
